package demo4;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 何华树
 * Date: 2024-10-18
 * Time: 21:21
 */
public class Main {
    public int removeElement(int[] nums, int val) {
        int count = 0;
        for (int i = 0; i < nums.length; i++) {
            if(nums[i] != val) {
                count++;
            }
        }
        return count;
    }
    public int removeDuplicates(int[] nums) {
        int count = 1;
        int newNum = nums[0];
        for (int i = 0; i < nums.length; i++) {
            if(nums[i] != newNum) {
                nums[count] = nums[i];
                newNum = nums[i];
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {

    }
    public static String func (String str){
        boolean[] che = new boolean[127];
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (che[ch] == false) {
                stringBuilder.append(ch);
                che[ch] = true;
            }
        }
        return stringBuilder.toString();
    }



        public static void main1 (String[]args){
            Scanner scanner = new Scanner(System.in);
            while (scanner.hasNextLine()) {
                String str = scanner.nextLine();
                String ret = func(str);
                System.out.println(ret);
        }
    }
}

